package demo;

import javax.servlet.*;
import java.io.IOException;
/*
Sharing Information Among Servlets
 */

public class AttributeSetterServlet implements Servlet {
    public void init(ServletConfig config) throws ServletException {
// bind an object that is to be shared among other servlets
        ServletContext servletContext = config.getServletContext();
        servletContext.setAttribute("password", "dingdong");
        servletContext.setAttribute("name", "kosta");
    }
    public void service(ServletRequest request, ServletResponse response)
            throws ServletException, IOException {
    }
    public void destroy() {
    }
    public String getServletInfo() {
        return null;
    }
    public ServletConfig getServletConfig() {
        return null;
    }
}